Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite: Refactor withShorterPathForNewBuildStore (backport #9505) #10059

Merged
merged 3 commits into from
May 30, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 29, 2024

This makes withShorterPathForNewBuildStore fit more nicely into the rest of the testing infrastructure.

  • Move withShorterPathForNewBuildStore to TestM monad
  • Move responsibility for passing --store-dir to cabalGArgs function
  • Move findDependencyInStore into TestM, and remove requirement to pass path to store directory.
  • Introduce testStoreDir function which returns the store location (and honours withShorterPathForNewBuildStore)
  • Migrate tests which use withShorterPathForNewBuildStore.

Please read Github PR Conventions and then fill in one of these two templates.


This is an automatic backport of pull request #9505 done by [Mergify](https://mergify.com).

This makes `withShorterPathForNewBuildStore` fit more nicely into the
rest of the testing infrastructure.

* Move `withShorterPathForNewBuildStore` to `TestM` monad
* Move responsibility for passing `--store-dir` to `cabalGArgs` function
* Move `findDependencyInStore` into `TestM`, and remove requirement to
  pass path to store directory.
* Introduce `testStoreDir` function which returns the store location
  (and honours `withShorterPathForNewBuildStore`)
* Migrate tests which use `withShorterPathForNewBuildStore`.

(cherry picked from commit 2a2d0b3)

# Conflicts:
#	Cabal-tests/Cabal-tests.cabal
#	Cabal-tests/lib/Test/Utils/TempTestDir.hs
Copy link
Contributor Author

mergify bot commented May 29, 2024

Cherry-pick of 2a2d0b3 has failed:

On branch mergify/bp/3.12/pr-9505
Your branch is up to date with 'origin/3.12'.

You are currently cherry-picking commit 2a2d0b304.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs
	modified:   cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs
	modified:   cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.test.hs
	modified:   cabal-testsuite/PackageTests/CopyHie/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/HaddockArgs/hoogle.test.hs
	modified:   cabal-testsuite/PackageTests/HaddockArgs/quickjump.test.hs
	modified:   cabal-testsuite/PackageTests/HaddockBuildDepends/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/build-local-package-with-custom-setup.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewConfigure/ConfigFile/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewFreeze/FreezeFile/new_freeze.test.hs
	modified:   cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs
	modified:   cabal-testsuite/PackageTests/Regression/T5409/use-different-versions-of-dependency-for-library-and-build-tool.test.hs
	modified:   cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs
	modified:   cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs
	modified:   cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs
	modified:   cabal-testsuite/src/Test/Cabal/Monad.hs
	modified:   cabal-testsuite/src/Test/Cabal/Prelude.hs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   Cabal-tests/Cabal-tests.cabal
	both modified:   Cabal-tests/lib/Test/Utils/TempTestDir.hs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@geekosaur
Copy link
Collaborator

If you want autosquash behavior, it needs to be fixup! not !fixup.

@ulysses4ever
Copy link
Collaborator

@geekosaur oh, my bad, thank you. that's mostly cargo-culting: I hope to employ mergify for that anyway, and it doesn't care about these things (I think).

@geekosaur
Copy link
Collaborator

geekosaur commented May 29, 2024

If you explicitly squash it doesn't; if you merge me it autosquashes fixup! and squash! commits, since we don't disable autosquash.

@ulysses4ever
Copy link
Collaborator

failure:


lib/Test/Utils/TempTestDir.hs:32:31: error:
Error:     Variable not in scope:
      (</>) :: m0 FilePath -> FilePath -> m FilePath
    Suggested fix:
      Perhaps use one of these:
        ‘<>’ (imported from Prelude), ‘<$>’ (imported from Prelude),
        ‘<*>’ (imported from Prelude)
   |
32 |          ; return $ systmpdir </> tmpRelDir } )
   |                               ^^^

should be easy to fix. If someone has cycles for it, that would be most welcome.

@geekosaur
Copy link
Collaborator

Anyone know what's up here? It doesn't look like any individual job failed, just some unexpected skips.

@ulysses4ever ulysses4ever added the squash+merge me Tell Mergify Bot to squash-merge label May 30, 2024
@mergify mergify bot merged commit acf9de7 into 3.12 May 30, 2024
51 checks passed
@mergify mergify bot deleted the mergify/bp/3.12/pr-9505 branch May 30, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants